package edu.udel.mboch.towerdefense;

public class PathPosition extends Position
{
	private static final long serialVersionUID = 6904918768303414367L;
	private int count;
	
	public PathPosition(int x, int y, int count)
	{
		super(x, y);
		this.count = count;
	}
	
	public int getCount()
	{
		return count;
	}
	
	public boolean isNextTo(PathPosition other)
	{
		return (Math.abs(x-other.x())==1 && Math.abs(y-other.y())==0) || (Math.abs(x-other.x())==0 && (Math.abs(y-other.y())==1));
	}
	
	public String toString()
	{
		return x + " " + y + " " + count;
	}
}
